from flask import Blueprint
from flask_restful import Api

from comment.utils.output import output_json

index_bp = Blueprint('index', __name__, url_prefix='/index')
index_api = Api(index_bp)#创建蓝图中的资源Api

# 使用我们自定义的JSON，替代装饰器的写法
index_api.representation('application/json')(output_json)

from Shopping.resources.index.index_resource import *

index_api.add_resource(Shopping_Category, '/category',endpoint='category')

# 添加用于测试datalist2dict函数的资源类
index_api.add_resource(Dict_test, '/dict_test',endpoint='dict_test')

# 新品推荐的资源类
index_api.add_resource(Shopping_HomeNewProduct, '/home_new_product',endpoint='home_new_product')

# 人气热搜的资源类
index_api.add_resource(Shopping_HomeRecommendProduct, '/home_recommend_product',endpoint='home_recommend_product')

# 专题的资源类
index_api.add_resource(Shopping_RecommendSubject, '/recommend_subject',endpoint='recommend_subject')
